package core;

import logic.PasswordCheck;
import ui.UserData;
import ui.UserMessage;

public class ApplicationRunner implements I_ApplicationRunner {

	public void startApplication() {
		@SuppressWarnings("unused")
		String password = getPasswordData();
		if(checkPassword(password) == true){
			
		}
		else {
			badPasswordMessage();
			startApplication();
		}
		
	}

	private void badPasswordMessage() {
		UserMessage userMessage = new UserMessage();
		userMessage.badPasswordMessage();
		
	}

	private boolean checkPassword(String password) {
		PasswordCheck passwordCheck = new PasswordCheck();
		if(passwordCheck.checkPassword(password) == true){
			return true;
		}
		return false;
	}

	private String getPasswordData() {
		UserData userData = new UserData();
		String password = userData.getPassword();
		return password;
	}

}
